<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>计算属性</title>

</head>
<body>


<div id="app">
    时间为:{{tm.getFullYear()}}年{{tm.getMonth()}}

</div>


<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let app = new Vue({
            el: "#app",
            data:{
                birthday:1529032123201 // 毫秒值
            },
            computed:{//计算属性
                tm(){
                    return new Date(this.birthday);
                }
            }

        })
    ;
</script>
</body>
</html>